1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package com.google.common.collect;
18
19 import java.util.Collection;
20
21 import javax.annotation.Nullable;
22
23
24
25
26
27
28
29
30 class ForwardingImmutableCollection<E> extends ImmutableCollection<E> {
31
32 transient final Collection<E> delegate;
33
34 ForwardingImmutableCollection(Collection<E> delegate) {
35 this.delegate = delegate;
36 }
37
38 @Override public UnmodifiableIterator<E> iterator() {
39 return Iterators.unmodifiableIterator(delegate.iterator());
40 }
41
42 @Override public boolean contains(@Nullable Object object) {
43 return object != null && delegate.contains(object);
44 }
45
46 @Override public boolean containsAll(Collection<?> targets) {
47 return delegate.containsAll(targets);
48 }
49
50 public int size() {
51 return delegate.size();
52 }
53
54 @Override public boolean isEmpty() {
55 return delegate.isEmpty();
56 }
57
58 @Override public Object[] toArray() {
59 return delegate.toArray();
60 }
61
62 @Override public <T> T[] toArray(T[] other) {
63 return delegate.toArray(other);
64 }
65
66 @Override public String toString() {
67 return delegate.toString();
68 }
69 }